#include <iostream>
#include "log.h"
#include <memory>
#include "tcpSocket.h"

sylar::Logger::ptr g_logger=DANIEL_LOG_NAME("g_logger");

int main()
{
    daniel::TcpSocket::ptr tcpSocket(new daniel::TcpSocket());
    tcpSocket->connectToHost("127.0.0.1",8888);
    tcpSocket->sendMsg("hello world");
    // int32_t errnoCopy;
    std::string recvMsg;
    tcpSocket->recvMsg(recvMsg);
    DANIEL_LOG_DEBUG(g_logger)<<"recvMsg:"<<recvMsg;
    tcpSocket->disconnect();
    return 0;
}